package com.renjun.smweb.service.AdminService;


import com.alibaba.fastjson.JSONObject;
import com.renjun.smweb.exceptions.*;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Map;

/**
 * Created by huamin on 2017/2/21.
 * 用户管理接口
 */
public interface AdminService {
    /**
     * 登录
     * @param params
     * @return
     * @throws SQLException
     * @throws BaseException
     */
    JSONObject login(Map<String,Object> params,HttpServletRequest request)throws SQLException,BaseException;

    /**
     * 用户列表
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject queryAdminUserList(Map<String,Object> params)throws SQLException,DataNotFoundException;

    /**
     * 导出用户列表
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject expAdminUserList(Map<String,Object> params) throws SQLException, DataNotFoundException, IOException, FileTypeNotFoundException;

    /**
     * 查看用户详情
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject queryAdminUserInformation(Map<String,Object> params)throws SQLException,DataNotFoundException;

    /**
     * 用户信息修改
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject updateUserInformation(Map<String,Object> params) throws SQLException, BaseException;

    /**
     * 新增用户
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject addAdminUser(Map<String,Object> params) throws SQLException, DataNotFoundException, ValidateSameSfzjhException, ValidateSameMobileException, ValidateSameEmailException, DictIsNotFoundException, DistrictIdException, UserNameException, Exception;

    /**
     * 用户注销
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject cancelAdminUser(Map<String,Object> params) throws SQLException, DataNotFoundException, DistrictIdException;

    /**
     * 用户恢复
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject recoveryAdminUser(Map<String,Object> params) throws SQLException, BaseException;

    /**
     * 清空邮箱
     * @param params id:用户id
     * @return message
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject clearUserEmail(Map<String,Object> params)throws SQLException,DataNotFoundException;

    /**
     * 重置用户密码
     * @param params id:用户id
     * @return message
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject recoverUserPwd(Map<String,Object> params) throws Exception;

    /**
     * 修改管理员密码
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject modifyAdminPwd(Map<String,Object> params) throws Exception;

    /**
     * 根据角色类型获取角色
     * @param params
     * @return
     * @throws SQLException
     * @throws DataNotFoundException
     */
    JSONObject getRoleByRoleType(Map<String,Object> params) throws Exception;
}
